<!DOCTYPE html>
<html>
{include file="public/head"}

<body>
    {include file="public/nav"} {include file="public/nav-2"}
    <div class="layui-container">
        <div class="layui-row layui-col-space15">
            <div class="layui-col-md8">
                <div class="fly-panel">
                    <div class="fly-panel-title">
                        <form method="get" action="{:url('web/Ranklist/index')}">
                            <div class="layui-form" style="text-align: center;">
                                <div class="layui-inline status-input-comb">
                                    <input type="text" name="user_id" placeholder="用户 ID" class="layui-input" value="{$user_id}">
                                </div>
                                <div class="layui-inline status-input-comb">
                                    <input type="text" name="nick" placeholder="用户名昵称" class="layui-input" value="{$nick}">
                                </div>
                                <div class="layui-inline status-input-comb">
                                    <button class="layui-btn" type="submit">开始查找</button>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
                <div style="text-align: center;">
                    {$list->render()}
                </div>
                <div class="fly-panel" style="margin-bottom: 0;">
                    <table class="layui-table" id="statuslist">
                        <colgroup>
                            <col width="50">
                            <col width="">
                            <col width="">
                            <col width="80">
                            <col width="80">
                        </colgroup>
                        <thead>
                            <tr class="layui-bg-green" lay-even lay-skin="nob">
                                <th>排名</th>
                                <th>用户名</th>
                                <th>昵称</th>
                                <th>解决数</th>
                                <th>提交数</th>
                            </tr>
                        </thead>
                        <tbody>
                            {foreach name="list" item="v"}
                            <tr>
                                <td>
                                    {switch name="startrank"} {case value="1"}<i class="layui-icon" style="font-size: 30px; color: #FFD306;"><span class="layui-inline">&#xe658;&#xe658;&#xe658;</span></i> {/case} {case value="2"}<i class="layui-icon" style="font-size: 30px; color: #ADADAD;"><span class="layui-inline">&#xe658;&#xe658;</i></span>{/case} {case value="3"}<i class="layui-icon" style="font-size: 30px; color: #C47222;">&#xe658;</i>{/case} {default /}{$startrank} {/switch}
                                    <?php 
                            $startrank++;
                        ?>
                                </td>
                                <td>
                                    <a href="{:url('web/Account/info','user_id='.$v['user_id'])}" class="fly-link fly-joinad">{$v.user_id}</a>
                                </td>
                                <td style="max-width: 200px;">
                                    <div style="overflow: hidden; width: 100%; position: relative; max-height: 20px;">
                                        <div style="position: relative; overflow: hidden; ">
                                            <p>{:htmlspecialchars($v.nick)}
                                            </p>
                                        </div>
                                    </div>
                                </td>
                                <td>{$v.solved}</td>
                                <td>{$v.submit}</td>
                            </tr>
                            {/foreach}
                        </tbody>
                    </table>
                </div>
                <div style="text-align: center;">
                    {$list->render()}
                </div>
            </div>
            {include file="public/ranklist-side"}
        </div>
    </div>
    {include file="public/foot"}
</body>
<script>
layui.use('form', function() {

});
</script>

</html>
